package com.xhwl.data.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhwl.common.dto.cent.sdata.RoomDTO;
import com.xhwl.common.pojo.cent.sdata.Room;
import com.xhwl.common.pojo.cent.sdata.RoomTypeCount;
import com.xhwl.common.pojo.cent.sdata.RoomTypeArea;
import com.xhwl.common.query.cent.sdata.RoomManageQuery;
import com.xhwl.common.query.cent.sdata.RoomQuery;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: luyi
 * @Description:
 * @Date: Create in 17:50 2021/1/21
 */
@Repository
public interface IRoomDao extends BaseMapper<Room> {

    List<Room> list(@Param("roomQuery") RoomQuery roomQuery);

    Page<Room> page(Page page, @Param("roomQuery") RoomQuery roomQuery);

    BigDecimal totalroomArea(@Param("roomIds") List<Integer> roomIds);

    List<RoomTypeArea> roomAreaByType(@Param("roomIds") List<Integer> roomIds);

    List<RoomTypeCount> roomCountByTypeCount(@Param("roomQuery") RoomQuery roomQuery);

    List<RoomDTO> managePage(@Param("roomManageQuery") RoomManageQuery roomManageQuery);

    Integer manageCount(@Param("roomManageQuery") RoomManageQuery roomManageQuery);

    /**
     * 获取当前id
     *
     * @return
     */
    @Select("select max(id) + 1 currentId from `cent_sdata`.`sdata_room`")
    Integer getCurrentId();

    List<Room> roomPicList(@Param("roomQuery") RoomQuery roomQuery);
}
